package kr.haggenna.branch.dao;

import java.util.List;

import kr.haggenna.branch.domain.Branch;

import org.mybatis.spring.support.SqlSessionDaoSupport;
import org.springframework.stereotype.Component;

@Component
public class BranchDaoImpl extends SqlSessionDaoSupport implements BranchDao {

	@Override
	public Branch selectBranch(Integer branchNum) {
		Branch command = (Branch)getSqlSession().selectOne("selectBranch",branchNum);
		return command;
	}

	@Override
	public List<Branch> getBranchList() {
		List<Branch> list = getSqlSession().selectList("branchList");
		return list;
	}
	
	@Override
	public Branch getBranchByName(String branchName) {
		Branch branch = getSqlSession().selectOne("getBranchByName", branchName);
		return branch;
	}
	
}
